package org.nightrunner.d3.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.search.annotations.DocumentId;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Index;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.Store;

/**
 * 参考与鸣谢表
 * 
 * @author NightRunner
 * @Date 2012-7-26
 * @version 1.0
 */

@Entity
@Indexed
@Table(name = "d3_reference", catalog = "d3")
public class Reference implements java.io.Serializable {

	private static final long serialVersionUID = 4623891446740040393L;

	@DocumentId
	private String referenceId;

	@Field(index = Index.TOKENIZED, store = Store.YES, name = "referenceName")
	private String referenceAuthorName;

	/* 类型,data为数据,bug为bug修复,reference为参考与引用 */
	private String referenceType;

	@Field(index = Index.TOKENIZED, store = Store.YES, name = "referenceDescription")
	private String referenceDescription;

	@Field(index = Index.TOKENIZED, store = Store.YES, name = "referenceName")
	private String referenceLink;

	@Field(index = Index.TOKENIZED, store = Store.YES, name = "referenceKeywords")
	private String referenceKeywords;

	@Column(name = "reference_description", length = 1024)
	public String getReferenceDescription() {
		return referenceDescription;
	}

	@Column(length = 200, name = "reference_type")
	public String getReferenceType() {
		return referenceType;
	}

	@Column(length = 200, name = "reference_author_name")
	public String getReferenceAuthorName() {
		return referenceAuthorName;
	}

	@Id
	@GeneratedValue(generator = "paymentableGenerator")
	@GenericGenerator(name = "paymentableGenerator", strategy = "uuid")
	@Column(name = "reference_id", nullable = false, length = 32)
	public String getReferenceId() {
		return this.referenceId;
	}

	@Column(length = 200, name = "reference_keywords")
	public String getReferenceKeywords() {
		return referenceKeywords;
	}

	@Column(length = 200, name = "reference_Link")
	public String getReferenceLink() {
		return referenceLink;
	}

	/** default constructor */
	public Reference() {
	}

	/** minimal constructor */
	public Reference(String referenceId) {
		this.referenceId = referenceId;
	}

	public void setReferenceKeywords(String referenceKeywords) {
		this.referenceKeywords = referenceKeywords;
	}

	public void setReferenceDescription(String referenceDescription) {
		this.referenceDescription = referenceDescription;
	}

	public void setReferenceId(String referenceId) {
		this.referenceId = referenceId;
	}

	public String toString() {
		return referenceAuthorName;
	}

	public void setReferenceLink(String referenceLink) {
		this.referenceLink = referenceLink;
	}

	public void setReferenceAuthorName(String referenceAuthorName) {
		this.referenceAuthorName = referenceAuthorName;
	}

	public void setReferenceType(String referenceType) {
		this.referenceType = referenceType;
	}

}